import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: './',
  build: {
    outDir: path.join(path.dirname(__dirname),'src/public'),
    emptyOutDir: true,
    rollupOptions: {
      output: {
        manualChunks: (filePath) => {
          if(filePath.includes('node_modules')) {
            return 'vendor';
          }
        }
      }
    }
  },
  resolve: {
    alias: [
      {
        find: '@',
        replacement: path.join(__dirname,'src')
      }
    ]
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `$injectedColor: orange;`
      }
    }
  }
})




